package cloud.demarcia.rabbitregister.controller;

import cloud.demarcia.rabbitregister.constant.RsaKey;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Bojun Wen, wen_bj@outlook.com
 * @date 2022.02.20
 */
@CrossOrigin
@RestController
@Slf4j
public class AuthController {

    @GetMapping("/key")
    public ResponseEntity<String> getPublicKey(){
        log.info("请求了公钥验证");
        return ResponseEntity.ok(RsaKey.getPublicKeyStr());
    }
}
